﻿namespace Server
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Runtime.Serialization;

    /// <summary>
    /// Central stock, local shop
    /// </summary>
    [DataContract]    
    public class PlaceView
    {

        #region INullable Members

        private bool m_Null = false;

        public bool IsNull
        {
            get { return this.m_Null; }
        }

        public static PlaceView Null
        {
            get
            {
                return new PlaceView(0)
                {
                    m_Null = true
                };
            }
        }

        #endregion

        [DataMember]
        public int Id { get; private set; }

        [DataMember]
        public string Name { get; set; }

        [DataMember]
        public string Address { get; set; }

        /// <summary>
        /// Central stock, local shop
        /// </summary>
        /// <param name="placeId">if 0 - create new place, >0 - get concrete place from db using linq</param>
        public PlaceView(int placeId)
        {
            this.Id = placeId;
        }
    }//class
}